package com.ciquan.server.util.web;

import org.apache.commons.lang.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by kakalee on 14/10/21.
 */
public class ParamterUtils {

    public static String getParameter(HttpServletRequest request, String name) {
        return getParameter(request, name, "");
    }

    public static String getParameter(HttpServletRequest request, String name, String defaultValue) {
        String value = request.getParameter(name);
        if(StringUtils.isBlank(value)) {
            value = defaultValue;
        }

        return value;
    }
}
